package org.jeecg.modules.basic.material.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Description: 物料信息管理
 * @Author: jeecg-boot
 * @Date: 2023-08-02
 * @Version: V1.0
 */
@Data
@TableName("wms_basic_material")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "wms_basic_material对象", description = "物料信息管理")
public class BasicMaterial implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**
     * 创建日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新日期
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
    /**
     * 所属部门
     */
    @ApiModelProperty(value = "所属部门")
    @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "org_code")
    private String sysOrgCode;
    /**
     * 物料名称
     */
    @Excel(name = "物料名称", width = 15)
    @ApiModelProperty(value = "物料名称")
    private String name;
    /**
     * 物料编码
     */
    @Excel(name = "物料编码", width = 15)
    @ApiModelProperty(value = "物料编码")
    private String code;
    /**
     * 规格型号
     */
    @Excel(name = "规格型号", width = 15)
    @ApiModelProperty(value = "规格型号")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String specification;
    /**
     * 库存单位
     */
    @Excel(name = "库存单位", width = 15, dictTable = "wms_basic_unit", dicText = "name", dicCode = "id")
    @Dict(dictTable = "wms_basic_unit", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "库存单位")
    private String inventoryUnitId;
    /**
     * 物料分类
     */
    @Excel(name = "物料分类", width = 15, dictTable = "wms_basic_material_type", dicText = "name", dicCode = "id")
    @Dict(dictTable = "wms_basic_material_type", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "物料分类")
    private String materialTypeId;
    /**
     * 启用批次管理
     */
    @ApiModelProperty(value = "启用批次管理")
    private String batchManagementFlag;
    /**
     * 启用序列号管理
     */
    @ApiModelProperty(value = "启用序列号管理")
    private String numberManagementFlag;
    /**
     * 批次编码规则
     */
    @Dict(dictTable = "sys_fill_rule", dicText = "rule_name", dicCode = "id")
    @ApiModelProperty(value = "批次编码规则")
    private String batchRuleId;
    /**
     * 序列号编码规则
     */
    @Dict(dictTable = "sys_fill_rule", dicText = "rule_name", dicCode = "id")
    @ApiModelProperty(value = "序列号编码规则")
    private String numberRuleId;
    /**
     * 状态
     */
    @Excel(name = "状态", width = 15, dicCode = "is_enabled")
    @Dict(dicCode = "is_enabled")
    @ApiModelProperty(value = "状态")
    private String status;
    /**
     * 辅助单位
     */
    @Dict(dictTable = "wms_basic_unit", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "辅助单位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String assistantUnitId;
    /**
     * 1库存单位等于多少辅助单位
     */
    @ApiModelProperty(value = "1库存单位等于多少辅助单位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String number;
    /**
     * 仓库
     */
    @Dict(dictTable = "wms_basic_warehouse", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "仓库")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String warehouseId;
    /**
     * 库区
     */
    @Dict(dictTable = "wms_basic_warehouse_area", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "库区")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String warehouseAreaId;
    /**
     * 安全库存
     */
    @ApiModelProperty(value = "安全库存")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String safeInventory;
    /**
     * 最大库存
     */
    @ApiModelProperty(value = "最大库存")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String maxInventory;
    /**
     * 最小库存
     */
    @ApiModelProperty(value = "最小库存")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String minInventory;
    /**
     * 检验信息
     */
    @Dict(dicCode = "inspect_info")
    @ApiModelProperty(value = "检验信息")
    @Excel(name = "检验信息", width = 15)
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String inspect;
    /**
     * 载具
     */
    @Dict(dictTable = "wms_basic_material", dicText = "name", dicCode = "id")
    @ApiModelProperty(value = "载具")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String vehicleId;
    /**
     * 删除状态(0-正常,1-已删除)
     */
    @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
    @TableLogic
    private Integer delFlag;
    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    private Integer tenantId;
    //是否使用 大于0：使用；其他：未使用
    @ApiModelProperty(value = "是否使用 大于0：使用；其他：未使用")
    @Dict(dicCode = "yn")
    private Integer used;

    /**
     * 物料分类id集合
     */
    @TableField(exist = false)
    private List<String> materialTypeIds;
    /**
     * 物料分类名称
     */
    @TableField(exist = false)
    private String materialTypeName;

}
